package io.github.lamtong.osgi;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import java.time.LocalDateTime;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * API 接口模块自定义 {@link BundleActivator} 实现.
 *
 * @author Lam Tong
 */
public class ApiBundleActivator implements BundleActivator {

    private static final Logger logger = Logger.getLogger(ApiBundleActivator.class.getName());

    @Override
    public void start(BundleContext context) {
        logger.log(Level.INFO, "API Bundle start, time: " + LocalDateTime.now());
    }

    @Override
    public void stop(BundleContext context) throws Exception {
        logger.log(Level.INFO, "API Bundle stop, time: " + LocalDateTime.now());
    }

}
